// ImmKpMainWindow.h: interface for the ImmKpMainWindow class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_IMMKPMAINWINDOW_H__C6BDDA08_AEA7_11D5_AC47_0080C84E291C__INCLUDED_)
#define AFX_IMMKPMAINWINDOW_H__C6BDDA08_AEA7_11D5_AC47_0080C84E291C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <windows.h>
#include <stdio.h>
#include "ImmKpApplicationData.h"
#include "ImmKpFileInfo.h"
#include "resource.h"

#define STATUS1_1_INITIAL 1
#define STATUS1_2_UP2DATE 2
#define STATUS1_3_PROCESSING 3

#define BREAK_TEXT "Stop"
#define NOT_SET ""
#define UPDATE_THREAD 0
#define MAIN_THREAD 1
#define SHUTDOWN_THREAD 2
#define DIALOG_CFG_FILE	 "default.cfg"

class ImmKpApplicationData;
class ImmKpMainWindow  
{
public:
	int ReadDataFromDialog(HWND hwndDlg, int bThread);
	void CleanAfterBrokenThread(BOOL bLastThread);
	int bLastThread;	// 0 - UpdateThread; 1 - MainThread;
	ImmKpApplicationData *p1;
	HANDLE trd;
	DWORD trdID;
	HWND hDlgHwnd;
	char szExitButtonText[64];
	void RadioPressed(HWND hwndDlg, WORD id);
	char szStatus[128];
	void ReadDialogDataFromFile(char fileName[1024]);
//	ImmKpDialogData ikdd;
	BOOL pThreadProcessing;
	ImmKpFileInfo	*p_ikfi;
	int setDialogStatus1(int c);
	LRESULT DialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
	BOOL ServerOptionsFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
	BOOL CompressionFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
	HWND Create(HINSTANCE hInst);
	ImmKpMainWindow();
	virtual ~ImmKpMainWindow();

protected:
	void SetMinMax(HWND hwndDlg);
	void UnSetMinMax(HWND hwndDlg);
	int SaveDialogDataToFile(char* fileName);
	BOOL bFileNameInFocus;
	void UpDateBoundsGroup(HWND hwndDlg);
	void UpDateDialog(HWND hwndDlg);
	BOOL getServerOptionsData(HWND hwndsoDlg, char *serverName, int& serverPort);
	int cDialogStatus1;
	int cPrevStatus1;
private:
	HMENU hMenu;
};

#endif // !defined(AFX_IMMKPMAINWINDOW_H__C6BDDA08_AEA7_11D5_AC47_0080C84E291C__INCLUDED_)
